package ar.edu.unicen.pladema.ui.model;

import java.util.Vector;

import ar.edu.unicen.pladema.ui.model.points.AxisPoint;

public class PointManager {
	private Vector<AxisPoint> points;
	public PointManager() {
		points = new Vector<AxisPoint>();
		points.add(new AxisPoint(100,100));
		points.add(new AxisPoint(10,10));
		points.add(new AxisPoint(10,20));
		points.add(new AxisPoint(400,20));
	}

	public Vector<AxisPoint> getPoints() {
		return points;
	}

	public void move(AxisPoint from, AxisPoint to) {
		for (AxisPoint ap : points) {
			ap.move(from, to);
		}
		
	}

	public void doRandom(int w, int h) {
		points = new Vector<AxisPoint>();
		for (int i=0; i<10; i++) {
			points.add(new AxisPoint(((int) (Math.random() * w)),((int) (Math.random() * h))));
		}
		System.out.println("random with " + w + "x" + h + ":"+points.toString());
	}
}
